import {request} from '@umijs/max';
import * as API from "@/services";


/** 期刊人物 分页检索请求 */
export async function queryJournalPersonages(params: API.JournalPersonagePageQueryParams): Promise<API.RespPageResult<API.JournalPersonage>> {
  return request('/api/v1/journal-personage', {
    params,
  });
}

/** 期刊人物 详情请求 */
export async function queryJournalPersonage(bizId: API.EntityId): Promise<API.RespResult<API.JournalPersonage>> {
  return request(`/api/v1/journal-personage/${bizId}`);
}

/** 期刊人物 创建请求 */
export async function createJournalPersonage(entity: API.JournalPersonage_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-personage`, {
    method: 'POST',
    data: entity,
  });
}

/** 期刊人物 修改请求 */
export async function modifyJournalPersonage(entity: API.JournalPersonage_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-personage/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 期刊人物 修改(部分)请求 */
export async function patchJournalPersonage(entity: API.JournalPersonage_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-personage/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 期刊人物 删除请求 */
export async function deleteJournalPersonage(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-personage/${bizId}`, {
    method: 'DELETE',
  });
}

/** 期刊人物 批量删除请求 */
export async function deleteJournalPersonages(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-personage`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}


/** 期刊人物 启用 */
export async function enableJournalPersonage(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-personage/enable/${bizId}`, {
    method: 'PUT',
  });
}

/** 期刊人物 禁用 */
export async function disableJournalPersonage(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-personage/disable/${bizId}`, {
    method: 'PUT',
  });
}
